<?php
/*
 * [JINYUN!] (C)2001-2099 Jinyunweb.com
 * This is NOT a freeware, use is subject to license terms
 * $Id: 2017-12-13 03:39:35 apple $
*/
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'get';
cfc('core')->checklogin();
$return['show_setmobile']=cfc('core')->check_setmobile(1);
$return['show_setmember']=cfc('core')->check_setmember(1);
$return['item']=model('core/member')->detail($_SESSION['uid'],array('credit1','credit2','mobile','groupid','avatar','nickname'));
if($return['item']['groupid']){
	$return['item']['group']=pdo_getcolumn('core_member_groups',array('id'=>$return['item']['groupid'],'uniacid'=>$_SESSION['uniacid']),'title');
}else{
	$return['item']['group']='普通会员';
}
$setting=uni_setting('member_setting');
$return['registerset']=uni_setting('register');
$return['item']['barcode']='0-';
$return['item']['barcode'].=$_SESSION['uid']+10000000000000000;
$return['item']['sign']=$setting['sign']['open'];
$return['item']['tixians']=$setting['member']['tixians'];
$return['item']['cardbg']=$setting['cardbg'];
$member['ideal_money']=pdo_getcolumn('core_ideal_money',array('mid'=>$_SESSION['uid'],'uniacid'=>$_SESSION['uniacid']),'money');
$return['item']['ideal_money']=$member['ideal_money']?$member['ideal_money']:'0.00';
$return['item']['mycoupon']=pdo_count('jy_weishop_coupon_getlog',array('uniacid'=>$_SESSION['uniacid'],'mid'=>$_SESSION['uid'],'isuse'=>0),'id');
$wxcard_setting=uni_setting('wx_card_setting');
$wxcard_edit=uni_setting('wx_card_edit');
if($wxcard_edit['card_id'] && $wxcard_edit['status']==1 && $wxcard_setting['open']){
	//存在会员卡且允许领取微信会员卡，检查是否已领卡
	$check=pdo_getcolumn('core_fans',array('openid'=>$_SESSION['openid'],'uniacid'=>$_SESSION['uniacid'],'wxgid'=>$_SESSION['wechat_id']),'wxcard_code');
	if(!$check){
		$return['item']['wxcard']=1;
	}
}
if($_SESSION['os']=='mobile'){
	$htmls=array(
		'title'=>'会员中心',
		'list'=>array(
			array('type'=>'member_info','set'=>'core/member.set/','left_title'=>'余额','left_submit'=>'充值','left_field'=>'credit2','left_url'=>'core/member.recharge/','mid_url'=>'core/member.cavatar/','avatar_field'=>'avatar','group_field'=>'group','right_title'=>'积分','right_field'=>'credit1'),
			array('type'=>'menu_list','list'=>array(
				array('url'=>'core/member.mobile/','title'=>'绑定手机号','icon'=>'shouji','remark'=>''),
			)),
			array('type'=>'menu_list','list'=>array(
				array('url'=>'core/member.card/','title'=>'我的优惠券','icon'=>'youhuiquan1','remark'=>''),
			)),
			array('type'=>'menu_list','show'=>array('wxcard'=>1),'list'=>array(
				array('url'=>'core/member.wxcard/main','title'=>'领取微信会员卡','icon'=>'credit-card','remark'=>''),
			)),
			array('type'=>'menu_list','show'=>array('tixians'=>1),'list'=>array(
				array('url'=>'core/member.tixian/','title'=>'余额提现','icon'=>'zhuanzhang','remark'=>''),
			)),
			array('type'=>'menu_list','list'=>array(
				array('url'=>'core/member.credit_log/','title'=>'积分日志','icon'=>'qitashouru','remark'=>''),
			)),
			array('type'=>'menu_list','show'=>array('sign'=>1),'list'=>array(
				array('url'=>'core/member.qiandao/','title'=>'签到','icon'=>'wo1','remark'=>''),
			)),
			array('type'=>'menu_list','list'=>array(
				array('url'=>'core/member.address/','title'=>'收货地址管理','icon'=>'ditu','remark'=>''),
			)),
			array('type'=>'submit_list','list'=>array(
				array('url'=>'core/member.cpassword/','title'=>'修改密码'),
				array('url'=>'core/member.logout/','title'=>'退出登陆','title_color'=>'#fff','background'=>'#ff5555'),
			)),
		),
		/*'menu'=>array('icon_color'=>'red','title_color'=>'gree','list'=>array(
			array('title'=>'首页','icon'=>'icon-shouye','url'=>'core/home.welcome/'),
		)),*/
	);
	//$return['htmls']=$htmls;
}
$return['setpay']=uni_setting('pay');
$return['account']=$_SESSION['account'];
set_html('title','会员中心');
exi($return);